﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/PageTemplate.Master" AutoEventWireup="true"
    Codebehind="Service.aspx.cs" Inherits="FrameWork.web.Module.ITMS.Service.Service"
    Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageBody" runat="server">
    <!--link rel="stylesheet" type="text/css" href="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/css/subModal.css"-->

    <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/js/common.js"></script>

    <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/js/subModal.js"></script>
    
    <script type="text/javascript">
        var xmlhttp;
        function getData(UID)
        {
          //获取用户填写的名称
        
          //创建异步调用对象
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          //将对象状态与事件相关联
          xmlhttp.onreadystatechange=statechange;
          //加载要链接的页面
          xmlhttp.Open("POST","../CreateService/datapage.aspx?UID="+document.getElementById('<%=drpResolv.ClientID %>').value,true);
          //发送请求
          xmlhttp.Send();
        }
    function statechange()
    {
      //判断异步调用是否已经完成
      if(xmlhttp.readystate==4)
      {
        //判断完成的提示代码是否是OK状态
        if(xmlhttp.status==200)
        {  
           //将返回数据作为参数，传递给填充方法
           FillData(xmlhttp.responseText);
        }
      }
    }
    function FillData(strcity)
    {
        result=strcity.substring(0,strcity.lastIndexOf('\r\n\r\n<!DOCTYPE html '));
        document.getElementById('<%= txtMySolution.ClientID %>').value=result;

    }
    </script>

    <FrameWorkWebControls:HeadMenuWebControls ID="HeadMenuWebControls1" runat="server"
        HeadOPTxt="我的服务单信息" HeadTitleTxt="我的服务单">
    </FrameWorkWebControls:HeadMenuWebControls>
    <FrameWorkWebControls:TabOptionWebControls ID="TabOptionWebControls1" runat="server">
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem1" runat="server" Tab_Name="待解决服务单">
            <asp:GridView ID="GVUnsolve" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:TemplateField SortExpression="UID" Visible="False">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("UID") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="labUID" runat="server" Text='<%# Bind("UID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="服务单号">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocNO") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtUnsolve" runat="server" OnClick="lbtUnsolve_Click" Text='<%# Bind("DocNO") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="RepUserNO" HeaderText="报修人工号" />
                    <asp:BoundField DataField="RepUserName" HeaderText="报修人姓名" />
                    <asp:BoundField DataField="RepTitle" HeaderText="报修标题" />
                    <asp:BoundField DataField="DocDat" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="报修时间" />
                </Columns>
            </asp:GridView>
            <FrameWorkWebControls:AspNetPager ID="PagerUnsolve" runat="server" OnPageChanged="PagerUnsolve_PageChanged">
            </FrameWorkWebControls:AspNetPager>
        </FrameWorkWebControls:TabOptionItem>
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem2" runat="server" Tab_Name="已解决服务单">
            <asp:GridView ID="GVSolve" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="UID" SortExpression="UID" Visible="False" />
                    <asp:TemplateField HeaderText="服务单号">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ServDocNo") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtsolve" runat="server" OnClick="lbtUnsolve_Click" Text='<%# Bind("ServDocNo") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:BoundField DataField="RepUserNO" HeaderText="报修人工号" />
                    <asp:BoundField DataField="RepUserName" HeaderText="报修人姓名" />
                    <asp:BoundField DataField="RepTitle" HeaderText="报修标题" />
                    <asp:BoundField DataField="DocDat" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="报修时间" />
                </Columns>
            </asp:GridView>
            <FrameWorkWebControls:AspNetPager ID="PagerSolve" runat="server" OnPageChanged="PagerSolve_PageChanged">
            </FrameWorkWebControls:AspNetPager>
        </FrameWorkWebControls:TabOptionItem>
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem3" runat="server" Tab_Name="参与解决并关闭">
            <asp:GridView ID="GVAttachSolve" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="UID" SortExpression="UID" Visible="False" />
                    <asp:TemplateField HeaderText="服务单号">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocNO") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtAttachSolve" runat="server" OnClick="lbtUnsolve_Click" Text='<%# Bind("DocNO") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="RepUserNO" HeaderText="报修人工号" />
                    <asp:BoundField DataField="RepUserName" HeaderText="报修人姓名" />
                    <asp:BoundField DataField="RepTitle" HeaderText="报修标题" />
                    <asp:BoundField DataField="DocDat" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="报修时间" />
                </Columns>
            </asp:GridView>
            <FrameWorkWebControls:AspNetPager ID="PagerAttachSolve" runat="server" OnPageChanged="PagerAttachSolve_PageChanged">
            </FrameWorkWebControls:AspNetPager>
        </FrameWorkWebControls:TabOptionItem>
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem4" runat="server" Tab_Name="参与解决未关闭">
            <asp:GridView ID="GVAttachUnSolve" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="UID" SortExpression="UID" Visible="False" />
                    <asp:TemplateField HeaderText="服务单号">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocNO") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtAttachUnSolve" runat="server" OnClick="lbtUnsolve_Click" Text='<%# Bind("DocNO") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="RepUserNO" HeaderText="报修人工号" />
                    <asp:BoundField DataField="RepUserName" HeaderText="报修人姓名" />
                    <asp:BoundField DataField="RepTitle" HeaderText="报修标题" />
                    <asp:BoundField DataField="DocDat" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="报修时间" />
                </Columns>
            </asp:GridView>
            <FrameWorkWebControls:AspNetPager ID="PagerAttachUnSolve" runat="server" OnPageChanged="PagerAttachUnSolve_PageChanged">
            </FrameWorkWebControls:AspNetPager>
        </FrameWorkWebControls:TabOptionItem>
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem5" runat="server" Tab_Name="我的关注">
            <asp:GridView ID="GVAttend" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="UID" SortExpression="UID" Visible="False" />
                    <asp:TemplateField HeaderText="服务单号">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocNO") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtAttend" runat="server" OnClick="lbtUnsolve_Click" Text='<%# Bind("DocNO") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="RepUserNO" HeaderText="报修人工号" />
                    <asp:BoundField DataField="RepUserName" HeaderText="报修人姓名" />
                    <asp:BoundField DataField="RepTitle" HeaderText="报修标题" />
                    <asp:BoundField DataField="DocDat" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="报修时间" />
                </Columns>
            </asp:GridView>
            <FrameWorkWebControls:AspNetPager ID="PagerAttend" runat="server" OnPageChanged="PagerAttend_PageChanged">
            </FrameWorkWebControls:AspNetPager>
        </FrameWorkWebControls:TabOptionItem>
    </FrameWorkWebControls:TabOptionWebControls>
    <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
        <tr>
            <td class="table_body" style="height: 25px; width: 8%;">
                <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Small" Text="详细信息"></asp:Label></td>
            <td style="height: 25px; width: 10%;">
            </td>
            <td style="height: 25px; width: 8%;">
            </td>
            <td style="height: 25px; width: 10%;">
            </td>
            <td style="height: 25px; width: 8%;">
            </td>
            <td style="height: 25px; width: 10%;">
            </td>
        </tr>
        <tr>
            <td class="table_body" style="height: 25px; width: 8%;">
                服务单号</td>
            <td class="table_none" colspan="3">
                <asp:TextBox ID="txtServDocNo" runat="server" CssClass="text_input" ReadOnly="True" Width="216px"></asp:TextBox>
                <asp:TextBox ID="txtUid" runat="server" Visible="False"></asp:TextBox></td>
            <td class="table_none" colspan="2">
                </td>
        </tr>
        <tr>
            <td class="table_body" style="height: 25px; width: 8%;">
                报修标题</td>
            <td class="table_none" colspan="3">
                <asp:TextBox CssClass="text_input" ID="txtRepTitle" runat="server" Width="100%" ReadOnly="True"></asp:TextBox></td>
            <td class="table_none" colspan="2">
                </td>
        </tr>
        <tr>
            <td class="table_body" style="height: 125px; width: 8%;">
                具体内容</td>
            <td colspan="3" class="table_none" style="height: 125px;">
                <asp:TextBox ID="txtRepContext" runat="server" CssClass="text_input" Width="100%"
                    Height="114px" TextMode="MultiLine" ReadOnly="True"></asp:TextBox></td>
            <td class="table_none" colspan="2">
            </td>
        </tr>
        <tr>
            <td class="table_body" style="height: 125px; width: 8%;">
                已解决情况</td>
            <td colspan="3" class="table_none" style="height: 125px">
                <asp:TextBox ID="txtSolution" runat="server" CssClass="text_input" Width="100%" Height="168px"
                    TextMode="MultiLine" ReadOnly="True"></asp:TextBox></td>
            <td class="table_none" colspan="2">
            </td>
        </tr>
        <tr runat="server" id="tr1">
            <td class="table_body" style="height: 25px; width: 8%;">
                我的解决方案</td>
            <td class="table_none" colspan="2">
            </td>
            <td class="table_none" colspan="3">
            </td>
        </tr>
        <tr runat="server" id="tr2">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:Label ID="Label3" runat="server" Text="故障分类" Width="80px"></asp:Label><asp:DropDownList
                    ID="drpServTrobType" runat="server" Width="178px">
                </asp:DropDownList></td>
            <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
            </td>
        </tr>
        <tr runat="server" id="tr3">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:Label ID="Label4" runat="server" Text="问题分类" Width="80px"></asp:Label><asp:DropDownList
                    ID="drpServProbType" runat="server" Width="178px">
                </asp:DropDownList></td>
            <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
            </td>
        </tr>
        <tr runat="server" id="tr4">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:Label ID="Label2" runat="server" Text="通用解决方法" Width="80px"></asp:Label><asp:DropDownList
                    ID="drpResolv" runat="server" Width="178px" onchange="getData()">
                </asp:DropDownList></td>
            <td colspan="3" class="table_none" style="height: 25px">
            </td>
        </tr>
        <tr runat="server" id="tr5">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="3" class="table_none" style="height: 25px;">
                <asp:TextBox ID="txtMySolution" runat="server" CssClass="text_input" Height="114px"
                    TextMode="MultiLine" Width="100%"></asp:TextBox></td>
            <td colspan="3" class="table_none" style="height: 25px;">
            </td>
        </tr>
        <tr runat="server" id="tr6">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:CheckBox ID="chkSecAlloc" runat="server" Text="二次派单" Width="90px" onclick="CheckSecond()"/><asp:TextBox
                    ID="txtSecUserName" runat="server" CssClass="text_input" Width="120px"></asp:TextBox>
                <input id="btnFirstSelect" class="cbutton" name="buttonselect" onclick="javascript:ShowUserSelect('<%=txtSecUserName.ClientID %>','<%=txtSecUserID.ClientID %>');"
                    type="button" value="查询" />
                <input id="btnFirstClear" class="cbutton" onclick="cleanUser('<%=txtSecUserName.ClientID %>','<%=txtSecUserID.ClientID %>');"
                    type="button" value="清除" />
                <asp:TextBox ID="txtSecUserID" runat="server" CssClass="text_input" Style="display: none"
                    title="选择派单人员" Width="120px"></asp:TextBox></td>
            <td colspan="3" class="table_none" style="height: 25px">
                通知方式:<asp:CheckBox ID="chkSecUserEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                    ID="chkSecUserMsg" runat="server" Text="短消息" /></td>
        </tr>
        <tr runat="server" id="tr7">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:Label ID="Label5" runat="server" Text="指派关注人" Width="90px"></asp:Label><asp:TextBox
                    ID="txtSecAttUserName" runat="server" CssClass="text_input" Width="120px"></asp:TextBox>
                <input id="Button2" class="cbutton" name="buttonselect" onclick="javascript:ShowUserSelect('<%=txtSecAttUserName.ClientID %>','<%=txtSecAttID.ClientID %>');"
                    type="button" value="查询" />
                <input id="Button3" class="cbutton" onclick="cleanUser('<%=txtSecAttUserName.ClientID %>','<%=txtSecAttID.ClientID %>');"
                    type="button" value="清除" />
                <asp:TextBox ID="txtSecAttID" runat="server" CssClass="text_input" Style="display: none"
                    title="选择派单人员" Width="120px"></asp:TextBox></td>
            <td colspan="3" class="table_none" style="height: 25px">
                通知方式:<asp:CheckBox ID="chkSecAttEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                    ID="chkSecAttMsg" runat="server" Text="短消息" /></td>
        </tr>
        <tr runat="server" id="tr8">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                硬件更换信息</td>
            <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                IP地址更换信息</td>
        </tr>
        <tr runat="server" id="tr9">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:TextBox ID="txtHardwareInfo" runat="server" CssClass="text_input" Height="114px"
                    TextMode="MultiLine" Width="100%"></asp:TextBox></td>
            <td colspan="2" class="table_none" style="height: 25px;">
                <asp:TextBox ID="txtIPAddressInfo" runat="server" CssClass="text_input" Height="114px"
                    TextMode="MultiLine" Width="100%"></asp:TextBox></td>
            <td class="table_none" style="height: 25px; width: 8%;">
            </td>
        </tr>
        <tr runat="server" id="tr10">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="2" class="table_none" style="height: 25px;">
                通知管理员方式:<asp:CheckBox ID="chkHardNoticeEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                    ID="chkHardNoticeMsg" runat="server" Text="短消息" /></td>
            <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                通知管理员方式:<asp:CheckBox ID="chkIPAddrNotifyEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                    ID="chkIPAddrNotifyMsg" runat="server" Text="短消息" /></td>
        </tr>
        <tr runat="server" id="tr11">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="5" class="table_none" style="height: 25px">
                现场处理内容:</td>
        </tr>
        <tr runat="server" id="tr12">
            <td class="table_body" style="height: 25px; width: 8%;">
            </td>
            <td colspan="3" class="table_none" style="height: 25px">
                <asp:TextBox ID="txtContent" runat="server" CssClass="text_input" Height="114px"
                    TextMode="MultiLine" Width="100%"></asp:TextBox></td>
            <td colspan="2" class="table_none" style="height: 25px"></td>
        </tr>
        <tr id="SubmitTr" runat="server">
            <td colspan="6" align="right" style="width: 100%; height: 26px;">
                <asp:Button ID="btnClose" runat="server" CssClass="button_bak" Text="问题解决" OnClick="btnClose_Click" />
                <asp:Button ID="btnFinish" runat="server" CssClass="button_bak" Text="完成" OnClick="btnFinish_Click" />
                <input id="Reset1" class="button_bak" type="reset" value="重填" /></td>
        </tr>
    </table>
    <asp:Label ID="lblMailServer" runat="server" Text="Label" Visible="False"></asp:Label><asp:Label
                    ID="lblMailUser" runat="server" Text="Label" Visible="False"></asp:Label><asp:Label
                        ID="lblMailPwd" runat="server" Text="Label" Visible="False"></asp:Label><asp:Label
                            ID="lblMailAddr" runat="server" Text="Label" Visible="False"></asp:Label>
    <script language="javascript">
        //查找人员，传入显示姓名的文本框ID，用户ID文本框，标题
      function ShowUserSelect(txtName,txtID)
      {
         // showPopWin('选择用户','UserSelect.aspx?'+rand(10000000), 400, 400, AlertMessageBox,true,true)
         left=window.parent.document.getElementById('IframeLeft').style.width.replace('px','');
         
         w=document.body.clientWidth/2-200+parseInt(left);
         h=document.body.clientHeight/2+80;
    
        result=window.showModalDialog('../UserSelect.aspx?rnd='+Math.random(),'','dialogwidth:400px;dialogheight:400px;dialogtop:'+h+'px;dialogleft:'+w+'px');
        if(result==null)
        {
            return;
        }
         if(result.indexOf(',')>-1)
         {
            var returnvalues=result.split(',');
           
            document.getElementById(txtName).value=returnvalues[0];
            document.getElementById(txtID).value=returnvalues[1];
            
         }
      }            
      
      //清空USER
      function cleanUser(txtName,txtID)
      {
        document.getElementById(txtName).value='';
        document.getElementById(txtID).value='';
      }
      
      document.getElementById('tabLabel__0').onclick=function(){showTR();tabClick(0,5);};
      document.getElementById('tabLabel__1').onclick=function(){hindTR();tabClick(1,5);};
      document.getElementById('tabLabel__2').onclick=function(){hindTR();tabClick(2,5);};
      document.getElementById('tabLabel__3').onclick=function(){hindTR();tabClick(3,5);};
      document.getElementById('tabLabel__4').onclick=function(){hindTR();tabClick(4,5);};
      
      function hindTR()
      {
        document.getElementById('<%=tr1.ClientID %>').style.display='none';
        document.getElementById('<%=tr2.ClientID %>').style.display='none';
        document.getElementById('<%=tr3.ClientID %>').style.display='none';
        document.getElementById('<%=tr4.ClientID %>').style.display='none';
        document.getElementById('<%=tr5.ClientID %>').style.display='none';
        document.getElementById('<%=tr6.ClientID %>').style.display='none';
        document.getElementById('<%=tr7.ClientID %>').style.display='none';
        document.getElementById('<%=tr8.ClientID %>').style.display='none';
        document.getElementById('<%=tr9.ClientID %>').style.display='none';
        document.getElementById('<%=tr10.ClientID %>').style.display='none';
        document.getElementById('<%=tr11.ClientID %>').style.display='none';
        document.getElementById('<%=tr12.ClientID %>').style.display='none';
        document.getElementById('<%=SubmitTr.ClientID %>').style.display='none';
      }
      
      function showTR()
      {
        document.getElementById('<%=tr1.ClientID %>').style.display='';
        document.getElementById('<%=tr2.ClientID %>').style.display='';
        document.getElementById('<%=tr3.ClientID %>').style.display='';
        document.getElementById('<%=tr4.ClientID %>').style.display='';
        document.getElementById('<%=tr5.ClientID %>').style.display='';
        document.getElementById('<%=tr6.ClientID %>').style.display='';
        document.getElementById('<%=tr7.ClientID %>').style.display='';
        document.getElementById('<%=tr8.ClientID %>').style.display='';
        document.getElementById('<%=tr9.ClientID %>').style.display='';
        document.getElementById('<%=tr10.ClientID %>').style.display='';
        document.getElementById('<%=tr11.ClientID %>').style.display='';
        document.getElementById('<%=tr12.ClientID %>').style.display='';
        document.getElementById('<%=SubmitTr.ClientID %>').style.display='';
      }
      
      //二次派单选择时选中其他信息
      function CheckSecond()
      {
        if(document.getElementById('<%=chkSecAlloc.ClientID %>').checked)
        {
            document.getElementById('<%=chkSecUserEmail.ClientID %>').checked=true;
            document.getElementById('<%=chkSecUserMsg.ClientID %>').checked=true;
        }
        else
        {
            document.getElementById('<%=chkSecUserEmail.ClientID %>').checked=false;
            document.getElementById('<%=chkSecUserMsg.ClientID %>').checked=false;
        }
      }
    </script>

</asp:Content>
